﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ESRI.ArcGIS.ADF.BaseClasses;
using PlanningGIS.Framework;
using System.Drawing;

namespace PlanningGIS.DataConvert
{
    class btnDataImp : BaseCommand
    {
        /// <summary>
        ///作用：数据导入按钮
        /// </summary>
        private FrmDataImport frm = null;

        /// <summary>
        /// 应用程序框架
        /// </summary>
        IApplication m_Application = null;

        /// <summary>
        /// 构造函数
        /// </summary>
        public btnDataImp()
        {
            base.m_caption = "数据导入";
            base.m_toolTip = base.m_caption;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="hook"></param>
        public override void OnCreate(object hook)
        {
            m_Application = hook as IApplication;
        }

        /// <summary>
        /// 是否可用
        /// </summary>
        public override bool Enabled
        {
            get
            {
                return true;
            }
        }

        /// <summary>
        /// 点击事件
        /// </summary>
        public override void OnClick()
        {
            if (frm == null || frm.IsDisposed)
            {
                frm = new FrmDataImport();
                frm.Show((m_Application as IFramework).MdiForm);
            }
            else
            {
                frm.BringToFront();
            }
        }
    }
}
